﻿using System.Drawing;
using Janus.Windows.GridEX.EditControls;

namespace HiStaff.Control
{
    [ToolboxBitmap(typeof(CheckedComboBox))]
    public class HiCheckedComboBox : CheckedComboBox
    {
        private bool _isRequire = false;
        private bool _readOnlyWhenEdit = false;
        private bool _searchControl = false;
        public bool SearchControl
        {
            get { return _searchControl; }
            set { _searchControl = value; }
        }
        public bool ReadOnlyWhenEdit
        {
            get { return _readOnlyWhenEdit; }
            set { _readOnlyWhenEdit = value; }
        }
        public bool IsRequire { get { return _isRequire; } set { _isRequire = value; } }
        public HiCheckedComboBox()
        {
            this.VisualStyle = Janus.Windows.GridEX.VisualStyle.Office2010;
            this.ComboStyle = Janus.Windows.GridEX.ComboStyle.DropDownList;
        }
        protected override void OnCreateControl()
        {
            base.OnCreateControl();
            if (_isRequire)
                this.BackColor = HiStaff.iSystem.Data.COLOR_REQUIREMENT;
            else this.BackColor = HiStaff.iSystem.Data.COLOR_NONREQUIREMENT;
        }
    }
}
